<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    const obj = {x: 4, a: 10, c:200 }
   /*  let arr = []
    for (const k in obj) {
     arr.push(k)
    }
    console.log(arr); */
    //Object.keys(obj) 将对象的所有的键收集到一个数组中
    console.log(Object.keys(obj).sort());
    //Object.values(obj) 将对象的所有的值收集到一个数组中
    console.log(Object.values(obj));
  </script>
</body>
</html>